package com.example.asus.testskip.DGPhone.phone;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.asus.testskip.R;


/* renamed from: dg.ca.com.DGPhone.phone.Title */
public class Title extends RelativeLayout {
    private Context mContext = null;
    private TextView mTitleTv = null;

    public Title(Context context) {
        super(context);
        this.mContext = context;
        init();
    }

    public Title(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        this.mContext = context;
        init();
    }

    public Title(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.mContext = context;
        init();
    }

    private void init() {
        LayoutInflater.from(this.mContext).inflate(R.layout.title_layout, this, true);
    }

    /* access modifiers changed from: protected */
    public void onFinishInflate() {
        this.mTitleTv = (TextView) findViewById(R.id.title_title_tv);
    }

    public void setBackListener(OnClickListener listener) {
        setTitlePadding();
    }

    public void setTitle(CharSequence text) {
        this.mTitleTv.setText(text);
    }

    public void setTitle(int resId) {
        this.mTitleTv.setText(resId);
    }

    public void setSureListener(String text, OnClickListener listener) {
        setTitlePadding();
    }

    private void setTitlePadding() {
        this.mTitleTv.setPadding(0, 0, 0, dp2px(this.mContext, 8.5f));
    }

    private int dp2px(Context ctx, float dipValue) {
        return (int) ((ctx.getResources().getDisplayMetrics().density * dipValue) + 0.5f);
    }
}
